<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <script src="../js/vue.js"></script>
    </head>
    <body>
        <div id="demo"></div>
        <script>
            let name = 'atguigu'
            let obj = {
                age:10
            }

            Object.defineProperty(obj, 'name', {
                get(){
                    return name;
                },
                set(val){
                    name = val
                }
            })

            console.log(obj.name, name)

            obj.name = '尚硅谷'
            console.log(obj.name, name)
            
            console.log('obj: ',obj)


        </script>
    </body>
</html>